package com.cms.room

import androidx.databinding.BaseObservable
import androidx.databinding.Bindable
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey

/**
 * @author: Mr.You
 * @create: 2022-10-10 08:55
 * @description:
 **/
@Entity(tableName = "student_table")
class Student():BaseObservable(){
   /* @PrimaryKey(autoGenerate = true)
    @ColumnInfo(name="student_id")
    var id:Long=0*/
    @PrimaryKey
    @get:Bindable
    @ColumnInfo(name = "student_name")
    var name: String =""
    set(value) {
        field = value
        notifyPropertyChanged(BR.name)
    }
    @get:Bindable
    @ColumnInfo(name = "student_age")
    var age:Int =0
    set(value) {
        field = value
        notifyPropertyChanged(BR.age)
    }
    @Ignore
    var height = 0 //不会存入数据表


}
